@echo off
setlocal

set "port=54321"  REM 要检查的端口号

REM 使用 netstat 命令检查端口状态
netstat -ano | findstr /C:":%port%" > nul
if %errorlevel% equ 0 (
    echo Port %port% is already in use.
    echo Cannot start dmServer.exe
) else (
    echo Port %port% is available,Running the exe... "%~dp0\dmServer.exe"
    start "" "%~dp0\dmServer.exe"
)
pause
endlocal
